# surfparc_mass_images_20070917.bash
# mass images

resultsdir=/mri_projects/ASD_Analysis/Scripts/fc_verify

function combineimg() {
  sbjid=$1

  temp_front_file=$resultsdir"/screencaps/19_temp/fsaverage4_if_lh_lat.tif"
  temp_back_file=$resultsdir"/screencaps/19_temp/fsaverage4_if_lh_med.tif"
  temp_result_file=$resultsdir"/screencaps/19_temp/fsaverage4_if_lh_front_back.tif"

  convert $temp_front_file $temp_back_file -gravity east -append $temp_result_file

  lh_front_file=$resultsdir"/screencaps/"$sbjid"/fsaverage4_if_lh_lat.tif"
  lh_back_file=$resultsdir"/screencaps/"$sbjid"/fsaverage4_if_lh_med.tif"
  lh_result_file=$resultsdir"/screencaps/"$sbjid"/fsaverage4_if_lh_front_back.tif"

  convert $lh_front_file $lh_back_file -gravity east -append $lh_result_file

  rh_front_file=$resultsdir"/screencaps/"$sbjid"/fsaverage4_if_rh_lat.tif"
  rh_back_file=$resultsdir"/screencaps/"$sbjid"/fsaverage4_if_rh_med.tif"
  rh_result_file=$resultsdir"/screencaps/"$sbjid"/fsaverage4_if_rh_front_back.tif"
  convert $rh_front_file $rh_back_file -gravity east -append $rh_result_file

  final_name=$resultsdir"/screencaps/wb_"$sbjid"_fs4_if.png"
  convert $temp_result_file $lh_result_file $rh_result_file -gravity north +append $final_name

  rm $lh_result_file
  rm $rh_result_file
  rm $temp_result_file
}

# ASD
# combineimg GU2_28809
# combineimg GU2_28796
# combineimg GU2_28820
# combineimg GU2_28843
# combineimg GU2_28761
# combineimg GU2_28778
# combineimg GU2_28791
# combineimg GU2_28768
# combineimg GU2_28822
# combineimg GU2_28808
# combineimg GU2_28754
# combineimg GU2_28815

# HC
combineimg GU2_28793
combineimg GU2_28767
combineimg GU2_28804
combineimg GU2_28837
combineimg GU2_28766
combineimg GU2_28847
combineimg GU2_28845
combineimg GU2_28746
combineimg GU2_28828
combineimg GU2_28792
combineimg GU2_28744
combineimg GU2_28798
combineimg GU2_28806